Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed loading of Library given a non-absolute path #2265

Merged
merged 2 commits into from
Aug 17, 2023

Conversation

cmaglie
Copy link
Member

@cmaglie cmaglie commented Aug 16, 2023

Givin a relative path is not ideal, but at least allows the CLI to compile the sketch correctly.

Please check if the PR fulfills these requirements

See how to contribute

  • The PR has no duplicates (please search among the Pull Requests
    before creating one)
  • The PR follows
    our contributing guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)
  • UPGRADING.md has been updated with a migration guide (for breaking changes)
  • configuration.schema.json updated if new parameters are added.

What kind of change does this PR introduce?

This PR makes the Library loader a bit more resilient by allowing relative paths as input.
Using relative paths may lead to other problems, but at least this change allows the CLI to not bail out with weird errors.

What is the current behavior?

If a relative path is given (via directories configuration in arduino-cli.yaml) in some cases the path composition during compile fails. See #2180 for an example.

What is the new behavior?

The compilation succeeds.

Does this PR introduce a breaking change, and is titled accordingly?

No

Other information

Fix #2180

Givin a relative path is not ideal, but at least allows the CLI to
compile the sketch correctly.
@cmaglie cmaglie added topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project labels Aug 16, 2023
@cmaglie cmaglie self-assigned this Aug 16, 2023
@cmaglie cmaglie added this to the Arduino CLI 0.34.0 milestone Aug 16, 2023
@codecov
Copy link

codecov bot commented Aug 16, 2023

Codecov Report

Patch coverage: 50.00% and project coverage change: +0.07% 🎉

Comparison is base (246adf9) 62.94% compared to head (5a8d5c4) 63.01%.
Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2265      +/-   ##
==========================================
+ Coverage   62.94%   63.01%   +0.07%     
==========================================
  Files         220      220              
  Lines       19540    19546       +6     
==========================================
+ Hits        12299    12317      +18     
+ Misses       6151     6142       -9     
+ Partials     1090     1087       -3     
Flag Coverage Δ
unit 63.01% <50.00%> (+0.07%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
arduino/libraries/loader.go 91.13% <50.00%> (-1.63%) ⬇️

... and 2 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@cmaglie cmaglie merged commit 9510d61 into arduino:master Aug 17, 2023
89 checks passed
@cmaglie cmaglie deleted the fix_non_abs_lib_path_loading branch August 17, 2023 07:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Compiler uses wrong library path when compiling with a local profile
2 participants